@file-services/resolve
Isomorphic, fs-agnostic implementation of the Node resolution algorithm.
Implements the following behaviors:
Getting started
Install library in project:
npm i @file-services/resolve
Then, use the programmatic API:
import { createRequestResolver } from "@file-services/resolve";
import { createMemoryFs } from "@file-services/memory";
const fs = createMemoryFs({
"some-folder": {
"index.js": "some content",
},
});
const resolveRequest = createRequestResolver({ fs });
resolveRequest("/", "./some-folder");
License
MIT